<?php
    
    namespace App\Observers;

    use App\System\Cis\Model\CisAdminRole;
    use App\System\Log\Repositories\LogAdminRepository;

    class CisAdminRoleObserver
    {

        /**
         * 监听用户更新的事件。
         *
         * @param  CisAdminRole  $cisAdminRole
         * @return void
         */
        public function updated(CisAdminRole $cisAdminRole)
        {
            $data['type'] = 1;
            $data['log_info'] = '修改管理员角色信息';
            $logAdmin = LogAdminRepository::getInstance();
            $logAdmin->saveAdminLog($data);
        }

        /**
         * @param CisAdminRole $cisAdminRole
         */
        public function created(CisAdminRole $cisAdminRole)
        {
            $data['type'] = 1;
            $data['log_info'] = '新增管理员角色';
            $logAdmin = LogAdminRepository::getInstance();
            $logAdmin->saveAdminLog($data);
        }

        /**
         * @param CisAdminRole $cisAdminRole
         */
        public function deleted(CisAdminRole $cisAdminRole)
        {
            $data['type'] = 1;
            $data['log_info'] = '删除管理员角色';
            $logAdmin = LogAdminRepository::getInstance();
            $logAdmin->saveAdminLog($data);
        }

    }
     
    